10 HOME
20 PRINT CHR$(4);"PR#3"
21 DIM B(20,80)
22 DIM C(1510)
23 DIM W(1,80)
24 X1=10:Y1=42:BB=0:B=0

30 ONERR GOTO 31


31 INVERSE:VTAB 1:HTAB 30:PRINT"MAZE PAINTER TOOL":VTAB 23:HTAB 1:PRINT"                                                                               ":VTAB 23:HTAB 26:PRINT"PRESS ANY KEY TO BE CONTINUE"
32 VTAB 23:HTAB 55:GET Z$:VTAB 23:HTAB 55:PRINT Z$:NORMAL


33 ONERR GOTO 34

34 HOME:INVERSE:VTAB 23:HTAB 1:PRINT" PLEASE INSERT A DATA DISK IN SLOT 6 DRIVE 2,THEN PRESS <SPC> TO BE CONTINUE. ":VTAB 23:HTAB 79:GET G$:VTAB 23:HTAB 79:PRINT G$:NORMAL

35 IF G$<>" " THEN 34

36 NORMAL:D2=1:GOSUB 15800


39 NORMAL:HOME:ONERR GOTO 22200



40 VTAB 10:HTAB 40:PRINT " "
45 VTAB 10:HTAB 40:PRINT "M"
50 INVERSE:VTAB 10:HTAB 42:PRINT "$":NORMAL
52 VTAB 20:HTAB 6:PRINT"Y":VTAB 20:HTAB 10:PRINT"I":VTAB 20:HTAB 15:PRINT"R - RUN":VTAB 20:HTAB 32:PRINT"S - SAVE MAZE":VTAB 20:HTAB 66:PRINT"DOLLAR :    0"
54 VTAB 21 :HTAB 5:PRINT"G H":VTAB 21:HTAB 9:PRINT"J K":VTAB 21:HTAB 15:PRINT"F - PAINTER":VTAB 21:HTAB 32:PRINT"L - LOAD MAZE":VTAB 21:HTAB 47:PRINT"X - CATALOG":VTAB 21:HTAB 66:PRINT"  STEP :    0"
56 VTAB 22 :HTAB 6:PRINT"B":VTAB 22:HTAB 10:PRINT"M":VTAB 22:HTAB 15:PRINT"Q - QUIT":VTAB 22:HTAB 32:PRINT"C - CLEAR SCN":VTAB 22:HTAB 66:PRINT"RESTEP :    0"

58 INVERSE:VTAB 23:HTAB 1:PRINT"                                                                               ":NORMAL
59 GOSUB 1200

60 R1=0:NO=0
62 VTAB 10:HTAB 40:PRINT"M":INVERSE:VTAB X1:HTAB Y1:PRINT "$":VTAB 23:HTAB 1:PRINT"COMMAND :                                                                     ":VTAB 23:HTAB 11:GET A$:GOSUB 59000:VTAB 23:HTAB 11:PRINT A$:NORMAL
65 IF A$="Q" THEN 7000

74 IF A$=CHR$(25) THEN X2=X1-1:Y2=Y1:GOSUB 54000
75 IF A$=CHR$(7) THEN X2=X1:Y2=Y1-1:GOSUB 54000
76 IF A$=CHR$(8) THEN X2=X1:Y2=Y1+1:GOSUB 54000
77 IF A$=CHR$(2) THEN X2=X1+1:Y2=Y1:GOSUB 54000

78 IF A$="I" THEN X2=X1-1:Y2=Y1:GOSUB 54100
80 IF A$="J" THEN X2=X1:Y2=Y1-1:GOSUB 54100
90 IF A$="K" THEN X2=X1:Y2=Y1+1:GOSUB 54100
95 IF A$="M" THEN X2=X1+1:Y2=Y1:GOSUB 54100

100 IF A$="Y" THEN X2=X1-1:Y2=Y1:GOSUB 54200
110 IF A$="G" THEN X2=X1:Y2=Y1-1:GOSUB 54200
120 IF A$="H" THEN X2=X1:Y2=Y1+1:GOSUB 54200
130 IF A$="B" THEN X2=X1+1:Y2=Y1:GOSUB 54200
160 IF A$="R" THEN 300

162 IF A$="F" THEN 30000


172 IF A$="S" THEN 15000
180 IF A$="L" THEN 15100
182 IF A$="C" THEN 15500
184 IF A$="X" THEN 15800


191 IF A$=CHR$(6) THEN 33000

200 GOTO 60

300 X4=10:Y4=40:I1=1:S1=0:H2=0
305 VTAB 20:HTAB 47:PRINT"           ":VTAB 21:HTAB 75:PRINT"   0":VTAB 22:HTAB 75:PRINT"   0"
310 IF B(10,40)=1 THEN B(10,40)=0:VTAB 10:HTAB 40:PRINT"M":BB=BB-1:GOSUB 1200

312 REM  

314 IF B(X4,Y4+1)=1 AND B(X4+1,Y4+1)=1 AND B(X4+1,Y4)=1 AND B(X4+1,Y4-1)=1 AND B(X4,Y4-1)=1 AND B(X4-1,Y4-1)=1 AND B(X4-1,Y4)=1 AND B(X4-1,Y4+1)=1 THEN INVERSE:VTAB 20:HTAB 47:PRINT"NO EXIT":NORMAL:GOTO 60


315 VTAB X4:HTAB Y4:PRINT"M"
320 X5=X4:Y5=Y4
330 IF B(X4+1,Y4-1)=0 THEN XX=X4+1:YY=Y4-1:Q=5:F1=1:GOTO 530
340 IF B(X4+1,Y4)=0 THEN XX=X4+1:YY=Y4:Q=4:F1=2:GOTO 530
350 IF B(X4+1,Y4+1)=0 THEN XX=X4+1:YY=Y4+1:Q=6:F1=3:GOTO 530
360 IF B(X4,Y4+1)=0 THEN XX=X4:YY=Y4+1:Q=3:F1=4:GOTO 530
370 IF B(X4-1,Y4+1)=0 THEN XX=X4-1:YY=Y4+1:Q=7:F1=5:GOTO 530
380 IF B(X4-1,Y4)=0 THEN XX=X4-1:YY=Y4:Q=2:F1=6:GOTO 530
390 IF B(X4-1,Y4-1)=0 THEN XX=X4-1:YY=Y4-1:Q=8:F1=7:GOTO 530
395 IF B(X4,Y4-1)=0 THEN XX=X4:YY=Y4-1:Q=1:F1=8:GOTO 530
400 I1=I1-1:IF I1<1 THEN I1=1
410 A7=C(I1):C(I1)=23:H2=H2+1:N1=22:N2=78:GOSUB 900
420 IF A7=1 THEN YY=Y4+1:XX=X4
430 IF A7=4 THEN XX=X4-1:YY=Y4
440 IF A7=3 THEN YY=Y4-1:XX=X4
450 IF A7=2 THEN XX=X4+1:YY=Y4
460 IF A7=5 THEN XX=X4-1:YY=Y4+1
470 IF A7=6 THEN XX=X4-1:YY=Y4-1
480 IF A7=7 THEN XX=X4+1:YY=Y4-1
490 IF A7=8 THEN XX=X4+1:YY=Y4+1
500 GOTO 550
530 IF B(XX,YY)=2 THEN XX=X4:YY=Y4:ON F1 GOTO 340,350,360,370,380,390,395,400
540 C(I1)=Q:I1=I1+1
550 VTAB X4:HTAB Y4:PRINT" ":B(XX,YY)=2 
560 IF XX>19 OR XX<1 OR YY>79 OR YY<1 THEN VTAB X5:HTAB Y5:PRINT" ":GOSUB 27000:S1=0:H2=0:GOTO 650
570 X4=XX:Y4=YY:VTAB X4:HTAB Y4:PRINT"M":VTAB X5:HTAB Y5:PRINT" "
575 IF XX=10 AND YY=40 THEN R1=R1+1 
577 IF R1>8 THEN R1=0:NO=1:INVERSE:VTAB 20:HTAB 47:PRINT"NO EXIT":NORMAL:GOTO 650
580 S1=S1+1:N1=21:N2=78
590 IF S1>9 THEN N2=N2-1
600 IF S1>99 THEN N2=N2-1
610 IF S1>999 THEN N2=N2-1
620 VTAB N1:HTAB N2: PRINT S1
640 GOTO 315

650 INVERSE:VTAB 23:HTAB 1:PRINT"              WAITING                       ":NORMAL

660 FOR I=0 TO 20
670 FOR J=0 TO 80
680 IF B(I,J)<>1 THEN B(I,J)=0
690 NEXT J
700 NEXT I
705 INVERSE:VTAB 23:HTAB 15:PRINT"        ":NORMAL
710 IF NO=1 THEN NO=0:GOTO 60
720 INVERSE:VTAB 20:HTAB 47:PRINT"SHORTCUT":NORMAL
730 X7=10:Y7=40:I2=1
740 IF C(I2)=5 THEN X8=X7+1:Y8=Y7-1
750 IF C(I2)=4 THEN X8=X7+1:Y8=Y7
760 IF C(I2)=6 THEN X8=X7+1:Y8=Y7+1
770 IF C(I2)=3 THEN X8=X7:Y8=Y7+1
780 IF C(I2)=7 THEN X8=X7-1:Y8=Y7+1
790 IF C(I2)=2 THEN X8=X7-1:Y8=Y7
792 IF C(I2)=8 THEN X8=X7-1:Y8=Y7-1 
794 IF C(I2)=1 THEN X8=X7:Y8=Y7-1
796 IF X8>19 OR X8<1 OR Y8>79 OR Y8<1 THEN VTAB X7:HTAB Y7:PRINT" ":VTAB 20:HTAB 47:PRINT"            ":GOTO 60
800 VTAB X8:HTAB Y8:PRINT"M":VTAB X7:HTAB Y7:PRINT" ":X7=X8:Y7=Y8
810 I2=I2+1
880 GOTO 740

900 IF H2>9 THEN N2=N2-1
910 IF H2>99 THEN N2=N2-1
920 IF H2>999 THEN N2=N2-1
930 VTAB N1:HTAB N2: PRINT H2
940 RETURN




1000 IF X2<1 THEN X2=19
1010 IF X2>19 THEN X2=1
1020 IF Y2<1 THEN Y2=79
1030 IF Y2>79 THEN Y2=1
1040 RETURN

1100 IF B(X1,Y1)=0 THEN BB=BB+1
1110 RETURN 

1150 IF B(X1,Y1)=1 THEN BB=BB-1
1160 RETURN

1200 IF BB<0 THEN BB=0
1210 IF BB<10 AND BB>-1 THEN NN1=78
1220 IF BB<100 AND BB>9 THEN NN1=77
1230 IF BB<1000 AND BB>99 THEN NN1=76
1240 IF BB<10000 AND BB>999 THEN NN1=75
1242 VTAB 20:HTAB 75:PRINT"    "
1260 VTAB 20:HTAB NN1:PRINT BB
1270 RETURN

1400 N1=21:N2=78
1410 IF S1>9 THEN N2=N2-1
1420 IF S1>99 THEN N2=N2-1
1430 IF S1>999 THEN N2=N2-1
1440 VTAB N1:HTAB N2: PRINT S1
1450 RETURN


1500 IF XP<1 THEN XP=1
1510 IF XP>19 THEN XP=19
1520 IF YP<1 THEN YP=1
1530 IF YP>79 THEN YP=79
1540 RETURN



7000 HOME:PRINT CHR$(4);"CATALOG"+",D1,S6":END












14900 BB=0

14902 FOR I=1 TO 19
14910 FOR J=1 TO 79
14920 IF B(I,J)=1 THEN VTAB I:HTAB J:PRINT"$":BB=BB+1
14922 IF B(I,J)=0 THEN VTAB I:HTAB J:PRINT" "
14930 NEXT J
14940 NEXT I

14942 GOSUB 1200

14950 RETURN




15000 INVERSE:VTAB 23:HTAB 1:PRINT"                                                 ":VTAB 23:HTAB 1:INPUT"FILENAME : ";F$:NORMAL
15005 INVERSE:VTAB 23:HTAB 50:PRINT"SAVING":NORMAL
15007 IF F$=CHR$(43) THEN INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL:GOTO 60

15009 IF LEN(F$) > 24 THEN INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL:GOTO 15000



15012 PRINT CHR$(4);"OPEN";F$
15020 PRINT CHR$(4);"WRITE";F$ 
15030 FOR I=1 TO 19
15040 FOR J=1 TO 79
15050 PRINT B(I,J)
15060 NEXT J
15070 NEXT I
15072 PRINT CHR$(4);"CLOSE";F$

15074 X9=10:Y9=40:V8=10:V9=38:G1=0:MA=0

15075 M(1)=1:M(2)=2:M(3)=3:M(4)=4:M(5)=5:M(6)=6:M(7)=7:M(8)=8

15076 T$="R  DR  D  DL  L  UL  U  UR "


15081 PRINT CHR$(4);"OPEN";F$+".INDEX"
15082 PRINT CHR$(4);"WRITE";F$+".INDEX"
15083 PRINT X1:PRINT Y1:PRINT X9:PRINT Y9:PRINT V8:PRINT V9:PRINT G1:PRINT M(1):PRINT M(2):PRINT M(3):PRINT M(4):PRINT M(5):PRINT M(6):PRINT M(7):PRINT M(8):PRINT T$:PRINT MA
15084 PRINT CHR$(4);"CLOSE";F$+".INDEX"

15086 PRINT CHR$(4);"OPEN";F$+".BITMAP"
15088 PRINT CHR$(4);"WRITE";F$+".BITMAP" 
15090 FOR I=1 TO 19
15092 FOR J=1 TO 79
15093 PRINT B(I,J);
15094 NEXT J
15095 PRINT
15096 NEXT I
15097 PRINT CHR$(4);"CLOSE";F$+".BITMAP"

15098 INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL
15099 GOTO 60

15100 INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":VTAB 23:HTAB 1:INPUT"FILENAME : ";F$:NORMAL
15105 INVERSE:VTAB 23:HTAB 50:PRINT"LOADING":NORMAL
15106 IF F$=CHR$(43) THEN INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL:GOTO 60



15110 REM 
15120 PRINT CHR$(4);"READ";F$ 
15130 FOR I=1 TO 19
15140 FOR J=1 TO 79
15150 INPUT B(I,J)
15160 NEXT J
15170 NEXT I
15180 PRINT CHR$(4);"CLOSE";F$
15181 REM 
15182 PRINT CHR$(4);"READ";F$+".INDEX"
15183 INPUT X1:INPUT Y1:INPUT X9:INPUT Y9:INPUT V8:INPUT V9:INPUT G1:INPUT M(1):INPUT M(2):INPUT M(3):INPUT M(4):INPUT M(5):INPUT M(6):INPUT M(7):INPUT M(8):INPUT T$:INPUT MA
15184 PRINT CHR$(4);"CLOSE";F$+".INDEX"
15185 IF M(5)=0 THEN FOR I=1 TO 8:M(I)=I:NEXT I:T$="R  DR  D  DL  L  UL  U  UR "

15186 INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL
15187 GOSUB 15200



15188 REM 

15189 NORMAL:VTAB 20:HTAB 45:PRINT"                     "
15190 LL=1:GOSUB 1200:GOTO 60

15200 BB=0:VTAB 20:HTAB 75:PRINT"    ":VTAB 21:HTAB 75:PRINT"   0":VTAB 22:HTAB 75:PRINT"   0" 
15202 FOR I=1 TO 19
15210 FOR J=1 TO 79
15220 IF B(I,J)=1 THEN VTAB I:HTAB J:PRINT"$":BB=BB+1:GOSUB 1200
15222 IF B(I,J)<>1 THEN VTAB I:HTAB J:PRINT" "
15230 NEXT J
15240 NEXT I
15250 RETURN


15500 NORMAL:VTAB 20:HTAB 45:PRINT"                     ":INVERSE:VTAB 23:HTAB 66:PRINT"             ":NORMAL

15502 FOR I=1 TO 19
15510 FOR J=1 TO 79
15520 VTAB I:HTAB J:PRINT" "
15530 NEXT J
15540 NEXT I

15542 FOR I=0 TO 20
15543 FOR J=0 TO 80
15544 B(I,J)=0
15545 NEXT J
15546 NEXT I

15547 FOR I=0 TO 1510:C(I)=0:NEXT I

15548 BB=0
15549 VTAB 20:HTAB 75:PRINT"   0":VTAB 21:HTAB 75:PRINT"   0":VTAB 22:HTAB 75:PRINT"   0"
15550 GOTO 60

15800 HOME
15802 PRINT CHR$(4);"CATALOG"+",D2,S6"
15810 PRINT:PRINT"<PRESS ANY KEY TO BE CONTINUE>":NORMAL:GET CT$:PRINT CT$
15820 HOME:BB=0
15830 FOR I=1 TO 19
15840 FOR J=1 TO 79
15850 IF B(I,J)=1 THEN VTAB I:HTAB J:PRINT"$":BB=BB+1
15860 NEXT J
15870 NEXT I

15880 IF D2=1 THEN D2=0:RETURN

15990 GOTO 52



22200 INVERSE:VTAB 23:HTAB 50:PRINT"ERROR OCCURED":NORMAL:FOR I=1 TO 50000:NEXT I:GOTO 60



24000 FOR I=1 TO 19
24010 FOR J=1 TO 79
24020 IF B(I,J)=1 THEN VTAB I:HTAB J:PRINT"$":GOTO 24040
24030 VTAB I:HTAB J:PRINT" "
24040 NEXT J
24050 NEXT I

24060 RETURN

27000 S1=S1+1:N1=21:N2=78
27010 IF S1>9 THEN N2=N2-1
27020 IF S1>99 THEN N2=N2-1
27030 IF S1>999 THEN N2=N2-1
27040 VTAB N1:HTAB N2: PRINT S1
27050 RETURN



29000 IF X1=10 AND Y1=40 THEN 29040
29010 IF B(X1,Y1)=1 THEN NORMAL:VTAB X1:HTAB Y1:PRINT"$"
29020 IF B(X1,Y1)=0 THEN NORMAL:VTAB X1:HTAB Y1:PRINT" "
29030 IF X2=10 AND Y2=40 THEN 29050
29040 INVERSE:VTAB X2:HTAB Y2:PRINT"$":NORMAL
 

29050 RETURN


30000 REM 

30002 INVERSE:VTAB 23:HTAB 1:PRINT"COMMAND :                                                                     ":VTAB 23:HTAB 50:PRINT"MAZE PAINTER  ":VTAB 23:HTAB 11:GET A$:GOSUB 59000:VTAB 23:HTAB 11:PRINT A$:NORMAL

30010 IF A$="R" THEN R2=1:X2=10:Y2=42:GOTO 31000
30020 IF A$="F" THEN PP=1:X2=10:Y2=42:GOTO 31000

30040 IF A$=CHR$(43) THEN INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL:GOSUB 15200:GOSUB 1200:GOTO 60

30060 GOTO 30002

31000 VTAB 10:HTAB 40:PRINT"M":INVERSE:VTAB X1:HTAB Y1:PRINT"$":NORMAL

31001 IF PP=1 THEN INVERSE:VTAB 23:HTAB 1:PRINT"COMMAND :                                                                     ":VTAB 23:HTAB 50:PRINT"FLIP":VTAB 23:HTAB 11:GET A$:GOSUB 59000:VTAB 23:HTAB 11:PRINT A$:NORMAL
31002 IF R2=1 THEN INVERSE:VTAB 23:HTAB 1:PRINT"COMMAND :                                                                     ":VTAB 23:HTAB 50:PRINT"ROTATE":VTAB 23:HTAB 11:GET A$:GOSUB 59000:VTAB 23:HTAB 11:PRINT A$:NORMAL

31066 IF A$=CHR$(25) THEN X2=X1-1:Y2=Y1:GOSUB 1000:GOSUB 29000:X1=X2:Y1=Y2
31067 IF A$=CHR$(7) THEN X2=X1:Y2=Y1-1:GOSUB 1000:GOSUB 29000:X1=X2:Y1=Y2
31068 IF A$=CHR$(8) THEN X2=X1:Y2=Y1+1:GOSUB 1000:GOSUB 29000:X1=X2:Y1=Y2
31069 IF A$=CHR$(2) THEN X2=X1+1:Y2=Y1:GOSUB 1000:GOSUB 29000:X1=X2:Y1=Y2

31070 IF A$=CHR$(43) THEN R2=0:PP=0:INVERSE:VTAB X1:HTAB Y1:PRINT"$":NORMAL:VTAB 10:HTAB 40:PRINT"M":INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL:GOTO 30002

31080 IF A$="B" THEN 32000

31090 GOTO 31000


32000 INVERSE:VTAB X1:HTAB Y1:PRINT"B":B=1:XS=X1:YS=Y1:NORMAL

32010 INVERSE:VTAB 23:HTAB 11:GET A$:GOSUB 59000:VTAB 23:HTAB 11:PRINT A$:NORMAL

32066 IF A$=CHR$(25) THEN X2=X1-1:Y2=Y1:GOSUB 1000:GOSUB 49000:VTAB 10:HTAB 40:PRINT"M":GOSUB 40000:X1=X2:Y1=Y2
32067 IF A$=CHR$(7) THEN X2=X1:Y2=Y1-1:GOSUB 1000:GOSUB 49000:VTAB 10:HTAB 40:PRINT"M":GOSUB 40000:X1=X2:Y1=Y2
32068 IF A$=CHR$(8) THEN X2=X1:Y2=Y1+1:GOSUB 1000:GOSUB 49000:VTAB 10:HTAB 40:PRINT"M":GOSUB 40000:X1=X2:Y1=Y2
32069 IF A$=CHR$(2) THEN X2=X1+1:Y2=Y1:GOSUB 1000:GOSUB 49000:VTAB 10:HTAB 40:PRINT"M":GOSUB 40000:X1=X2:Y1=Y2

32070 IF A$=CHR$(43) THEN GOSUB 49000:INVERSE:VTAB X1:HTAB Y1:PRINT"$":NORMAL:VTAB 10:HTAB 40:PRINT"M":GOTO 31000

32072 IF A$="I" AND R2=1 THEN Q1=1:GOSUB 40000:GOSUB 49000:GOSUB 49500:GOSUB 40000:NORMAL:VTAB 10:HTAB 40:PRINT"M":GOTO 32010
32074 IF A$="J" AND R2=1 THEN Q2=1:GOSUB 40000:GOSUB 49000:GOSUB 49500:GOSUB 40000:NORMAL:VTAB 10:HTAB 40:PRINT"M":GOTO 32010
32075 IF A$="K" AND R2=1 THEN Q3=1:GOSUB 40000:GOSUB 49000:GOSUB 49500:GOSUB 40000:NORMAL:VTAB 10:HTAB 40:PRINT"M":GOTO 32010
32076 IF A$="M" AND R2=1 THEN Q4=1:GOSUB 40000:GOSUB 49000:GOSUB 49500:GOSUB 40000:NORMAL:VTAB 10:HTAB 40:PRINT"M":GOTO 32010

32077 IF A$="V" AND PP=1 THEN P1=1:GOSUB 40000:GOSUB 49000:GOSUB 49500:GOSUB 40000:NORMAL:VTAB 10:HTAB 40:PRINT"M":GOTO 32010
32078 IF A$="H" AND PP=1 THEN P2=1:GOSUB 40000:GOSUB 49000:GOSUB 49500:GOSUB 40000:NORMAL:VTAB 10:HTAB 40:PRINT"M":GOTO 32010


32080 GOTO 32010


33000 INVERSE:VTAB 23:HTAB 1:PRINT"                                                                              ":VTAB 23:HTAB 50:PRINT"MAZE FIXING":VTAB 23:HTAB 1:INPUT"FILENAME : ";F$:NORMAL


33002 IF F$=CHR$(43) THEN INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL:GOTO 60

33010 A9=10:B9=40:C8=10:D9=38:E1=0:FF=1

33012 N(1)=1:N(2)=2:N(3)=3:N(4)=4:N(5)=5:N(6)=6:N(7)=7:N(8)=8

33014 H$="R  DR  D  DL  L  UL  U  UR "


33081 REM 
33082 PRINT CHR$(4);"READ";F$+".INDEX"
33083 INPUT T1:INPUT T2
33084 PRINT CHR$(4);"CLOSE";F$+".INDEX"


33181 PRINT CHR$(4);"OPEN";F$+".INDEX"
33182 PRINT CHR$(4);"WRITE";F$+".INDEX"
33183 PRINT T1:PRINT T2:PRINT A9:PRINT B9:PRINT C8:PRINT D9:PRINT E1:PRINT N(1):PRINT N(2):PRINT N(3):PRINT N(4):PRINT N(5):PRINT N(6):PRINT N(7):PRINT N(8):PRINT H$:PRINT FF
33184 PRINT CHR$(4);"CLOSE";F$+".INDEX"

33186 INVERSE:VTAB 23:HTAB 50:PRINT"           ":VTAB 23:HTAB 12:PRINT"                              ":NORMAL

33190 GOTO 60



39000 IF X1=10 AND Y1=40 THEN 39040
39002 IF X1=XS AND Y1=YS THEN 39030
39010 IF B(X1,Y1)=1 THEN NORMAL:VTAB X1:HTAB Y1:PRINT"$"
39020 IF B(X1,Y1)=0 THEN NORMAL:VTAB X1:HTAB Y1:PRINT" "
39030 IF X2=10 AND Y2=40 THEN 39050
39040 INVERSE:VTAB X2:HTAB Y2:PRINT"$":NORMAL
 

39050 RETURN


40000 IF X2>XS AND Y2>YS THEN 40100
40010 IF X2<XS AND Y2<YS THEN 41100
40020 IF X2<XS AND Y2>YS THEN 42100
40030 IF X2>XS AND Y2<YS THEN 43100

40040 IF Y2=YS AND X2>XS THEN 44100
40050 IF Y2=YS AND X2<XS THEN 45100
40060 IF X2=XS AND Y2>YS THEN 46100
40070 IF X2=XS AND Y2<YS THEN 47100

40080 IF X2=XS AND Y2=YS THEN 48100

40090 RETURN



40100 INVERSE

40106 IF Q3=1 THEN Q3=0:NORMAL:GOSUB 50100:GOTO 40142
40107 IF Q2=1 THEN Q2=0:NORMAL:GOSUB 51100:GOTO 40142
40108 IF Q4=1 THEN Q4=0:NORMAL:GOSUB 52100:GOTO 40142
40109 IF Q1=1 THEN Q1=0:NORMAL:GOSUB 53100:GOTO 40142

40116 IF P1=1 THEN P1=0:NORMAL:GOSUB 55100:GOTO 40142
40117 IF P2=1 THEN P2=0:NORMAL:GOSUB 55200:GOTO 40142

40137 FOR I=XS TO X2:VTAB I:HTAB YS:PRINT" ":NEXT I
40138 FOR I=XS TO X2:VTAB I:HTAB Y2:PRINT" ":NEXT I
40139 FOR J=YS TO Y2:VTAB XS:HTAB J:PRINT" ":NEXT J
40140 FOR J=YS TO Y2:VTAB X2:HTAB J:PRINT" ":NEXT J 

40141 VTAB XS:HTAB YS:PRINT"B":VTAB X2:HTAB Y2:PRINT"E"

40142 NORMAL

40150 RETURN




41100 INVERSE

41106 IF Q3=1 THEN Q3=0:NORMAL:GOSUB 50200:GOTO 41142
41107 IF Q2=1 THEN Q2=0:NORMAL:GOSUB 51200:GOTO 41142
41108 IF Q4=1 THEN Q4=0:NORMAL:GOSUB 52200:GOTO 41142
41109 IF Q1=1 THEN Q1=0:NORMAL:GOSUB 53200:GOTO 41142



41116 IF P1=1 THEN P1=0:NORMAL:GOSUB 56100:GOTO 41142
41117 IF P2=1 THEN P2=0:NORMAL:GOSUB 56200:GOTO 41142



41137 FOR I=XS TO X2 STEP -1:VTAB I:HTAB YS:PRINT" ":NEXT I
41138 FOR I=XS TO X2 STEP -1:VTAB I:HTAB Y2:PRINT" ":NEXT I
41139 FOR J=YS TO Y2 STEP -1:VTAB XS:HTAB J:PRINT" ":NEXT J
41140 FOR J=YS TO Y2 STEP -1:VTAB X2:HTAB J:PRINT" ":NEXT J 

41141 VTAB XS:HTAB YS:PRINT"B":VTAB X2:HTAB Y2:PRINT"E"

41142 NORMAL
41150 RETURN



42100 INVERSE


42106 IF Q3=1 THEN Q3=0:NORMAL:GOSUB 50300:GOTO 42142
42107 IF Q2=1 THEN Q2=0:NORMAL:GOSUB 51300:GOTO 42142
42108 IF Q4=1 THEN Q4=0:NORMAL:GOSUB 52300:GOTO 42142
42109 IF Q1=1 THEN Q1=0:NORMAL:GOSUB 53300:GOTO 42142

42116 IF P1=1 THEN P1=0:NORMAL:GOSUB 57100:GOTO 42142
42117 IF P2=1 THEN P2=0:NORMAL:GOSUB 57200:GOTO 42142


42137 FOR I=XS TO X2 STEP -1:VTAB I:HTAB YS:PRINT" ":NEXT I
42138 FOR I=XS TO X2 STEP -1:VTAB I:HTAB Y2:PRINT" ":NEXT I
42139 FOR J=YS TO Y2:VTAB XS:HTAB J:PRINT" ":NEXT J
42140 FOR J=YS TO Y2:VTAB X2:HTAB J:PRINT" ":NEXT J 

42141 VTAB XS:HTAB YS:PRINT"B":VTAB X2:HTAB Y2:PRINT"E"

42142 NORMAL
42150 RETURN


43100 INVERSE

43106 IF Q3=1 THEN Q3=0:NORMAL:GOSUB 50400:GOTO 43142
43107 IF Q2=1 THEN Q2=0:NORMAL:GOSUB 51400:GOTO 43142
43108 IF Q4=1 THEN Q4=0:NORMAL:GOSUB 52400:GOTO 43142
43109 IF Q1=1 THEN Q1=0:NORMAL:GOSUB 53400:GOTO 43142

43116 IF P1=1 THEN P1=0:NORMAL:GOSUB 58100:GOTO 43142
43117 IF P2=1 THEN P2=0:NORMAL:GOSUB 58200:GOTO 43142



43137 FOR I=XS TO X2:VTAB I:HTAB YS:PRINT" ":NEXT I
43138 FOR I=XS TO X2:VTAB I:HTAB Y2:PRINT" ":NEXT I
43139 FOR J=YS TO Y2 STEP -1:VTAB XS:HTAB J:PRINT" ":NEXT J
43140 FOR J=YS TO Y2 STEP -1:VTAB X2:HTAB J:PRINT" ":NEXT J 

43141 VTAB XS:HTAB YS:PRINT"B":VTAB X2:HTAB Y2:PRINT"E"

43142 NORMAL
43150 RETURN


44100 INVERSE

44106 IF Q3=1 OR Q2=1 THEN Q3=0:Q2=0:GOTO 44142
44108 IF Q4=1 THEN Q4=0:NORMAL:GOSUB 52500:GOTO 44142
44109 IF Q1=1 THEN Q1=0:NORMAL:GOSUB 53500:GOTO 44142

44116 IF P2=1 THEN P2=0:GOTO 44142
44118 IF P1=1 THEN P1=0:NORMAL:GOSUB 59100:GOTO 44142

44120 FOR I=XS TO X2:VTAB I:HTAB YS:PRINT" ":NEXT I

44141 VTAB XS:HTAB YS:PRINT"B":VTAB X2:HTAB Y2:PRINT"E"

44142 NORMAL
44150 RETURN 


45100 INVERSE

45106 IF Q3=1 OR Q2=1 THEN Q3=0:Q2=0:GOTO 45142
45108 IF Q4=1 THEN Q4=0:NORMAL:GOSUB 52600:GOTO 45142
45109 IF Q1=1 THEN Q1=0:NORMAL:GOSUB 53600:GOTO 45142

45116 IF P2=1 THEN P2=0:GOTO 45142
45118 IF P1=1 THEN P1=0:NORMAL:GOSUB 60100:GOTO 45142


45120 FOR I=XS TO X2 STEP -1:VTAB I:HTAB YS:PRINT" ":NEXT I

45141 VTAB XS:HTAB YS:PRINT"B":VTAB X2:HTAB Y2:PRINT"E"

45142 NORMAL
45150 RETURN

46100 INVERSE

46106 IF Q3=1 THEN Q3=0:NORMAL:GOSUB 50500:GOTO 46142
46107 IF Q2=1 THEN Q2=0:NORMAL:GOSUB 51500:GOTO 46142

46108 IF Q4=1 OR Q1=1 THEN Q4=0:Q1=0:GOTO 46142


46116 IF P1=1 THEN P1=0:GOTO 46142
46118 IF P2=1 THEN P2=0:NORMAL:GOSUB 61100:GOTO 46142



46120 FOR J=YS TO Y2:VTAB XS:HTAB J:PRINT" ":NEXT J

46141 VTAB XS:HTAB YS:PRINT"B":VTAB X2:HTAB Y2:PRINT"E"

46142 NORMAL
46150 RETURN


47100 INVERSE

47106 IF Q3=1 THEN Q3=0:NORMAL:GOSUB 50600:GOTO 47142
47107 IF Q2=1 THEN Q2=0:NORMAL:GOSUB 51600:GOTO 47142
47108 IF Q4=1 OR Q1=1 THEN Q4=0:Q1=0:GOTO 47142


47116 IF P1=1 THEN P1=0:GOTO 47142
47118 IF P2=1 THEN P2=0:NORMAL:GOSUB 62100:GOTO 47142



47120 FOR J=YS TO Y2 STEP -1:VTAB XS:HTAB J:PRINT" ":NEXT J

47141 VTAB XS:HTAB YS:PRINT"B":VTAB X2:HTAB Y2:PRINT"E"

47142 NORMAL
47150 RETURN

48100 INVERSE


48106 IF Q3=1 OR Q1=1 OR Q2=1 OR Q4=1 THEN Q3=0:Q1=0:Q2=0:Q4=0:GOTO 48142

48108 IF P1=1 OR P2=1 THEN P1=0:P2=0:GOTO 48142




48110 VTAB XS:HTAB YS:PRINT" "

48141 VTAB XS:HTAB YS:PRINT"B":VTAB X2:HTAB Y2:PRINT"E"

48142 NORMAL
48150 RETURN



49000 FOR I=1 TO 19
49010 FOR J=1 TO 79
49020 IF B(I,J)=1 THEN VTAB I:HTAB J:PRINT"$":GOTO 49040
49030 VTAB I:HTAB J:PRINT" "
49040 NEXT J
49050 NEXT I
49060 RETURN

49500 BB=0

49502 FOR I=1 TO 19
49510 FOR J=1 TO 79
49520 IF B(I,J)=1 THEN BB=BB+1
49530 NEXT J
49540 NEXT I

49542 GOSUB 1200

49550 RETURN


50100 FOR I=XS TO X2
50110 W(1,I)=B(I,Y2)
50120 NEXT I

50130 FOR K=Y2 TO YS+1 STEP -1
50140 FOR I=XS TO X2
50150 B(I,K)=B(I,K-1)
50160 NEXT I
50170 NEXT K

50180 FOR I=XS TO X2
50182 B(I,YS)=W(1,I)
50184 NEXT I

50186 RETURN



50200 FOR I=X2 TO XS
50210 W(1,I)=B(I,YS)
50220 NEXT I

50230 FOR K=YS TO Y2+1 STEP -1
50240 FOR I=X2 TO XS
50250 B(I,K)=B(I,K-1)
50260 NEXT I
50270 NEXT K

50280 FOR I=X2 TO XS
50282 B(I,Y2)=W(1,I)
50284 NEXT I

50286 RETURN



50300 FOR I=X2 TO XS
50310 W(1,I)=B(I,Y2)
50320 NEXT I

50330 FOR K=Y2 TO YS+1 STEP -1
50340 FOR I=X2 TO XS
50350 B(I,K)=B(I,K-1)
50360 NEXT I
50370 NEXT K

50380 FOR I=X2 TO XS
50382 B(I,YS)=W(1,I)
50384 NEXT I

50386 RETURN



50400 FOR I=XS TO X2
50410 W(1,I)=B(I,YS)
50420 NEXT I

50430 FOR K=YS TO Y2+1 STEP -1
50440 FOR I=XS TO X2
50450 B(I,K)=B(I,K-1)
50460 NEXT I
50470 NEXT K

50480 FOR I=XS TO X2
50482 B(I,Y2)=W(1,I)
50484 NEXT I

50486 RETURN


50500 FOR I=XS TO X2
50510 W(1,I)=B(I,Y2)
50520 NEXT I

50530 FOR K=Y2 TO YS+1 STEP -1
50540 FOR I=XS TO X2
50550 B(I,K)=B(I,K-1)
50560 NEXT I
50570 NEXT K

50580 FOR I=XS TO X2
50582 B(I,YS)=W(1,I)
50584 NEXT I

50586 RETURN



50600 FOR I=XS TO X2
50610 W(1,I)=B(I,YS)
50620 NEXT I

50630 FOR K=YS TO Y2+1 STEP -1
50640 FOR I=XS TO X2
50650 B(I,K)=B(I,K-1)
50660 NEXT I
50670 NEXT K

50680 FOR I=XS TO X2
50682 B(I,Y2)=W(1,I)
50684 NEXT I

50686 RETURN

 




51100 FOR I=XS TO X2
51110 W(1,I)=B(I,YS)
51120 NEXT I

51130 FOR K=YS TO Y2-1
51140 FOR I=XS TO X2
51150 B(I,K)=B(I,K+1)
51160 NEXT I
51170 NEXT K

51180 FOR I=XS TO X2
51182 B(I,Y2)=W(1,I)
51184 NEXT I

51186 RETURN



51200 FOR I=X2 TO XS
51210 W(1,I)=B(I,Y2)
51220 NEXT I

51230 FOR K=Y2 TO YS-1
51240 FOR I=X2 TO XS
51250 B(I,K)=B(I,K+1)
51260 NEXT I
51270 NEXT K

51280 FOR I=X2 TO XS
51282 B(I,YS)=W(1,I)
51284 NEXT I

51286 RETURN



51300 FOR I=X2 TO XS
51310 W(1,I)=B(I,YS)
51320 NEXT I

51330 FOR K=YS TO Y2-1
51340 FOR I=X2 TO XS
51350 B(I,K)=B(I,K+1)
51360 NEXT I
51370 NEXT K

51380 FOR I=X2 TO XS
51382 B(I,Y2)=W(1,I)
51384 NEXT I

51386 RETURN



51400 FOR I=XS TO X2
51410 W(1,I)=B(I,Y2)
51420 NEXT I

51430 FOR K=Y2 TO YS-1
51440 FOR I=XS TO X2
51450 B(I,K)=B(I,K+1)
51460 NEXT I
51470 NEXT K

51480 FOR I=XS TO X2
51482 B(I,YS)=W(1,I)
51484 NEXT I

51486 RETURN


51500 FOR I=XS TO X2
51510 W(1,I)=B(I,YS)
51520 NEXT I

51530 FOR K=YS TO Y2-1
51540 FOR I=XS TO X2
51550 B(I,K)=B(I,K+1)
51560 NEXT I
51570 NEXT K

51580 FOR I=XS TO X2
51582 B(I,Y2)=W(1,I)
51584 NEXT I

51586 RETURN



51600 FOR I=XS TO X2
51610 W(1,I)=B(I,Y2)
51620 NEXT I

51630 FOR K=Y2 TO YS-1
51640 FOR I=XS TO X2
51650 B(I,K)=B(I,K+1)
51660 NEXT I
51670 NEXT K

51680 FOR I=XS TO X2
51682 B(I,YS)=W(1,I)
51684 NEXT I

51686 RETURN

 

52100 FOR I=YS TO Y2
52110 W(1,I)=B(X2,I)
52120 NEXT I

52130 FOR K=X2 TO XS+1 STEP -1
52140 FOR I=YS TO Y2
52150 B(K,I)=B(K-1,I)
52160 NEXT I
52170 NEXT K

52180 FOR I=YS TO Y2
52182 B(XS,I)=W(1,I)
52184 NEXT I

52186 RETURN



52200 FOR I=Y2 TO YS
52210 W(1,I)=B(XS,I)
52220 NEXT I

52230 FOR K=XS TO X2+1 STEP-1
52240 FOR I=Y2 TO YS
52250 B(K,I)=B(K-1,I)
52260 NEXT I
52270 NEXT K

52280 FOR I=Y2 TO YS
52282 B(X2,I)=W(1,I)
52284 NEXT I

52286 RETURN



52300 FOR I=YS TO Y2
52310 W(1,I)=B(XS,I)
52320 NEXT I

52330 FOR K=XS TO X2+1 STEP -1
52340 FOR I=YS TO Y2
52350 B(K,I)=B(K-1,I)
52360 NEXT I
52370 NEXT K

52380 FOR I=YS TO Y2
52382 B(X2,I)=W(1,I)
52384 NEXT I

52386 RETURN



52400 FOR I=Y2 TO YS
52410 W(1,I)=B(X2,I)
52420 NEXT I

52430 FOR K=X2 TO XS+1 STEP -1
52440 FOR I=Y2 TO YS
52450 B(K,I)=B(K-1,I)
52460 NEXT I
52470 NEXT K

52480 FOR I=Y2 TO YS
52482 B(XS,I)=W(1,I)
52484 NEXT I

52486 RETURN



52500 FOR I=YS TO Y2
52510 W(1,I)=B(X2,I)
52520 NEXT I

52530 FOR K=X2 TO XS+1 STEP -1
52540 FOR I=YS TO Y2
52550 B(K,I)=B(K-1,I)
52560 NEXT I
52570 NEXT K

52580 FOR I=YS TO Y2
52582 B(XS,I)=W(1,I)
52584 NEXT I

52586 RETURN


52600 FOR I=YS TO Y2
52610 W(1,I)=B(XS,I)
52620 NEXT I

52630 FOR K=XS TO X2+1 STEP -1
52640 FOR I=YS TO Y2
52650 B(K,I)=B(K-1,I)
52660 NEXT I
52670 NEXT K

52680 FOR I=YS TO Y2
52682 B(X2,I)=W(1,I)
52684 NEXT I

52686 RETURN

 
53100 FOR I=YS TO Y2
53110 W(1,I)=B(XS,I)
53120 NEXT I

53130 FOR K=XS TO X2-1
53140 FOR I=YS TO Y2
53150 B(K,I)=B(K+1,I)
53160 NEXT I
53170 NEXT K

53180 FOR I=YS TO Y2
53182 B(X2,I)=W(1,I)
53184 NEXT I

53186 RETURN



53200 FOR I=Y2 TO YS
53210 W(1,I)=B(X2,I)
53220 NEXT I

53230 FOR K=X2 TO XS-1
53240 FOR I=Y2 TO YS
53250 B(K,I)=B(K+1,I)
53260 NEXT I
53270 NEXT K

53280 FOR I=Y2 TO YS
53282 B(XS,I)=W(1,I)
53284 NEXT I

53286 RETURN



53300 FOR I=YS TO Y2
53310 W(1,I)=B(X2,I)
53320 NEXT I

53330 FOR K=X2 TO XS-1
53340 FOR I=YS TO Y2
53350 B(K,I)=B(K+1,I)
53360 NEXT I
53370 NEXT K

53380 FOR I=YS TO Y2
53382 B(XS,I)=W(1,I)
53384 NEXT I

53386 RETURN



53400 FOR I=Y2 TO YS
53410 W(1,I)=B(XS,I)
53420 NEXT I

53430 FOR K=XS TO X2-1
53440 FOR I=Y2 TO YS
53450 B(K,I)=B(K+1,I)
53460 NEXT I
53470 NEXT K

53480 FOR I=Y2 TO YS
53482 B(X2,I)=W(1,I)
53484 NEXT I

53486 RETURN



53500 FOR I=YS TO Y2
53510 W(1,I)=B(XS,I)
53520 NEXT I

53530 FOR K=XS TO X2-1
53540 FOR I=YS TO Y2
53550 B(K,I)=B(K+1,I)
53560 NEXT I
53570 NEXT K

53580 FOR I=YS TO Y2
53582 B(X2,I)=W(1,I)
53584 NEXT I

53586 RETURN


53600 FOR I=YS TO Y2
53610 W(1,I)=B(X2,I)
53620 NEXT I

53630 FOR K=X2 TO XS-1
53640 FOR I=YS TO Y2
53650 B(K,I)=B(K+1,I)
53660 NEXT I
53670 NEXT K

53680 FOR I=YS TO Y2
53682 B(XS,I)=W(1,I)
53684 NEXT I

53686 RETURN

 
54000 GOSUB 1000:GOSUB 29000:X1=X2:Y1=Y2
54010 RETURN

54100 GOSUB 1000:INVERSE:VTAB X2:HTAB Y2:PRINT"$":NORMAL:VTAB X1:HTAB Y1:PRINT"$":GOSUB 1100:B(X1,Y1)=1:GOSUB 1200:X1=X2:Y1=Y2
54110 RETURN

54200 GOSUB 1000:INVERSE:VTAB X2:HTAB Y2:PRINT"$":NORMAL:VTAB X1:HTAB Y1:PRINT" ":GOSUB 1150:B(X1,Y1)=0:GOSUB 1200:X1=X2:Y1=Y2
54210 RETURN



55100 AA=ABS(X2-XS)+1

55102 XP=XS:YP=YS:XQ=X2:YQ=Y2

55110 FOR I=1 TO INT(AA/2)
55120 FOR J=YP TO YQ
55130 W(1,J)=B(XP,J):B(XP,J)=B(XQ,J):B(XQ,J)=W(1,J)
55132 NEXT J
55140 XP=XP+1:XQ=XQ-1
55150 NEXT I

55160 RETURN


55200 AA=ABS(Y2-YS)+1

55202 XP=XS:YP=YS:XQ=X2:YQ=Y2

55210 FOR I=1 TO INT(AA/2)
55220 FOR J=XP TO XQ
55230 W(1,J)=B(J,YP):B(J,YP)=B(J,YQ):B(J,YQ)=W(1,J)
55232 NEXT J
55240 YP=YP+1:YQ=YQ-1
55250 NEXT I

55260 RETURN



56100 AA=ABS(X2-XS)+1

56102 XP=XS:YP=YS:XQ=X2:YQ=Y2

56110 FOR I=1 TO INT(AA/2)
56120 FOR J=YQ TO YP
56130 W(1,J)=B(XQ,J):B(XQ,J)=B(XP,J):B(XP,J)=W(1,J)
56132 NEXT J
56140 XP=XP-1:XQ=XQ+1
56150 NEXT I

56160 RETURN


56200 AA=ABS(Y2-YS)+1

56202 XP=XS:YP=YS:XQ=X2:YQ=Y2

56210 FOR I=1 TO INT(AA/2)
56220 FOR J=XQ TO XP
56230 W(1,J)=B(J,YQ):B(J,YQ)=B(J,YP):B(J,YP)=W(1,J)
56232 NEXT J
56240 YP=YP-1:YQ=YQ+1
56250 NEXT I

56260 RETURN



57100 AA=ABS(X2-XS)+1

57102 XP=XS:YP=YS:XQ=X2:YQ=Y2

57110 FOR I=1 TO INT(AA/2)
57120 FOR J=YP TO YQ
57130 W(1,J)=B(XQ,J):B(XQ,J)=B(XP,J):B(XP,J)=W(1,J)
57132 NEXT J
57140 XP=XP-1:XQ=XQ+1
57150 NEXT I

57160 RETURN


57200 AA=ABS(Y2-YS)+1

57202 XP=XS:YP=YS:XQ=X2:YQ=Y2

57210 FOR I=1 TO INT(AA/2)
57220 FOR J=XQ TO XP
57230 W(1,J)=B(J,YQ):B(J,YQ)=B(J,YP):B(J,YP)=W(1,J)
57232 NEXT J
57240 YP=YP+1:YQ=YQ-1
57250 NEXT I

57260 RETURN



58100 AA=ABS(X2-XS)+1

58102 XP=XS:YP=YS:XQ=X2:YQ=Y2

58110 FOR I=1 TO INT(AA/2)
58120 FOR J=YQ TO YP
58130 W(1,J)=B(XQ,J):B(XQ,J)=B(XP,J):B(XP,J)=W(1,J)
58132 NEXT J
58140 XP=XP+1:XQ=XQ-1
58150 NEXT I

58160 RETURN


58200 AA=ABS(Y2-YS)+1

58202 XP=XS:YP=YS:XQ=X2:YQ=Y2

58210 FOR I=1 TO INT(AA/2)
58220 FOR J=XP TO XQ
58230 W(1,J)=B(J,YQ):B(J,YQ)=B(J,YP):B(J,YP)=W(1,J)
58232 NEXT J
58240 YP=YP-1:YQ=YQ+1
58250 NEXT I

58260 RETURN

59000 IF A$=CHR$(10) OR A$=CHR$(13) OR A$=CHR$(22) OR A$=CHR$(12) OR A$=CHR$(11) OR A$=CHR$(17) OR A$=CHR$(23) OR A$=CHR$(21) OR A$=CHR$(27) THEN A$=" "
59002 RETURN


59100 AA=ABS(X2-XS)+1

59102 XP=XS:YP=YS:XQ=X2:YQ=Y2

59110 FOR I=1 TO INT(AA/2)
59120 FOR J=YQ TO YP
59130 W(1,J)=B(XQ,J):B(XQ,J)=B(XP,J):B(XP,J)=W(1,J)
59132 NEXT J
59140 XP=XP+1:XQ=XQ-1
59150 NEXT I

59160 RETURN



60100 AA=ABS(X2-XS)+1

60102 XP=XS:YP=YS:XQ=X2:YQ=Y2

60110 FOR I=1 TO INT(AA/2)
60120 FOR J=YQ TO YP
60130 W(1,J)=B(XQ,J):B(XQ,J)=B(XP,J):B(XP,J)=W(1,J)
60132 NEXT J
60140 XP=XP-1:XQ=XQ+1
60150 NEXT I

60160 RETURN



61100 AA=ABS(Y2-YS)+1

61102 XP=XS:YP=YS:XQ=X2:YQ=Y2

61110 FOR I=1 TO INT(AA/2)
61120 FOR J=XQ TO XP
61130 W(1,J)=B(J,YQ):B(J,YQ)=B(J,YP):B(J,YP)=W(1,J)
61132 NEXT J
61140 YP=YP+1:YQ=YQ-1
61150 NEXT I

61160 RETURN



62100 AA=ABS(Y2-YS)+1

62102 XP=XS:YP=YS:XQ=X2:YQ=Y2

62110 FOR I=1 TO INT(AA/2)
62120 FOR J=XQ TO XP
62130 W(1,J)=B(J,YQ):B(J,YQ)=B(J,YP):B(J,YP)=W(1,J)
62132 NEXT J
62140 YP=YP-1:YQ=YQ+1
62150 NEXT I

62160 RETURN














  